<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>slider.as</title>
<link rel="stylesheet" type="text/css" href="../../SourceStyles.css"/>
</head>

<body><pre>
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">sliderClasses</span>.<span class="ActionScriptDefault_Text">Slider</span>;
<span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">changeSlider</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">slider</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Slider</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
<span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptDefault_Text">caption</span>.<span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">slider</span>.<span class="ActionScriptDefault_Text">value</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptDefault_Text">qsChart</span>.<span class="ActionScriptDefault_Text">updateCarbonPrice</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">slider</span>.<span class="ActionScriptDefault_Text">value</span><span class="ActionScriptBracket/Brace">)</span>;
<span class="ActionScriptBracket/Brace">}</span> 

<span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">incSlider</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">slider</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Slider</span>, <span class="ActionScriptDefault_Text">inc</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
<span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptDefault_Text">slider</span>.<span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">+=</span>10 <span class="ActionScriptOperator">*</span> <span class="ActionScriptDefault_Text">inc</span>;
    <span class="ActionScriptComment">// Round to nearest 10:
</span>    <span class="ActionScriptDefault_Text">slider</span>.<span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">slider</span>.<span class="ActionScriptDefault_Text">value</span> <span class="ActionScriptOperator">/</span> 10<span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">*</span> 10;
    <span class="ActionScriptDefault_Text">changeSlider</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">slider</span><span class="ActionScriptBracket/Brace">)</span>;
<span class="ActionScriptBracket/Brace">}</span></pre></body>
</html>
